<template>
  <a-spin :spinning="loading" class="h-full pt-40">
    <div class="flex">
      <a-card class="flex-1 overflow-hidden" :body-style="{ padding: '0 8px', height: '100%', overflow: 'hidden' }">
        <a-tabs v-model:active-key="activeKey" class="workstation-tabs ant-tabs" destroy-inactive-tab-pane @change="onChangeTabs">
          <a-tab-pane key="tab1" tab="基本信息" />
          <a-tab-pane key="tab2" tab="住院信息" />
          <a-tab-pane key="tab3" tab="诊断信息" />
          <a-tab-pane key="tab4" tab="手术信息" />
          <a-tab-pane key="tab5" tab="费用信息" />
          <a-tab-pane key="tab6" tab="附页" />
          <template #rightExtra>
            <a-button v-if="isRoute" class="mr-2" @click="router.go(-1)">返回</a-button>
            <!-- @click="onClickTest" -->
            <a-button class="mr-2" @click="historyExpand = false">质控检测</a-button>
            <template v-if="formState.status !== 1">
              <a-button class="mr-2" @click="onSubmit(1)">提交</a-button>
              <a-button class="mr-2" type="primary" @click="onSave">保存</a-button>
            </template>
            <template v-else>
              <a-button class="mr-2" type="primary" @click="onSubmit(0)">撤销提交</a-button>
              <a-button class="mr-2" @click="onPrintSelect">打印</a-button>
            </template>
            <div class="absolute -top-[9999px]">
              <a-button ref="printRef" v-print="{ id: 'printDom' }" type="primary">打印</a-button>
            </div>
          </template>
        </a-tabs>
        <div class="form-box" :class="{ 'h-calc-120': formHeight }">
          <a-form v-if="!loading" id="printDom" class="form-style flex justify-between flex-wrap px-8 mt-4 w-[1200px] mx-auto">
            <BaseTitle id="tab1" title="基本信息" class="-ml-8" />
            <div class="w-full mt-2 flex relative">
              <!-- 系统名称 -->
              <div class="w-1/3 pr-10">医疗机构：{{ formState.acpMedinsName || '-' }}</div>
              <!-- 组织机构代码 -->
              <div class="w-1/3 text-center">组织机构代码：{{ formState.acpMedinsCode || '-' }}</div>
              <BaseBarcode v-if="formState.medcasno" :value="formState.medcasno" class="w-1/3 text-right absolute -top-6 right-0" />
            </div>

            <div class="w-full mt-4 flex justify-between">
              <a-form-item label="医疗付费方式" class="w-1/3 pr-5">
                <!-- <a-input v-model:value="formState.medfeePaymtdCode" :disabled="formState.status === 1" DT00289 value-key="mrCode"/> -->
                <SelectItem
                  v-model:value="formState.medfeePaymtdCode"
                  :disabled="formState.status === 1"
                  type="DT00289"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.medfeePaymtdCode = $event.value
                      formState.medfeePaymtdName = $event.label
                    }
                  "
                />
              </a-form-item>
              <div class="w-2/3">
                <!-- font-semibold -->
                <div class="text-4xl w-1/2 text-center">住院病案首页</div>
              </div>
            </div>
            <a-form-item label="健康卡号" class="w-1/3 pr-5">
              <a-input v-model:value="formState.jkkh" disabled />
            </a-form-item>
            <a-form-item label="" class="w-1/3 flex justify-center pl-2">
              <div class="flex items-end w-[200px]">
                第<a-input
                  :ref="(e) => setSubRef(e, 'patnIptCnt')"
                  v-model:value="formState.patnIptCnt"
                  class="text-center"
                  :disabled="formState.status === 1"
                />
                <div class="w-[65px]">次住院</div>
              </div>
            </a-form-item>
            <a-form-item label="病案号" class="w-1/3 pl-5">
              <a-input v-model:value="formState.medcasno" disabled />
            </a-form-item>
            <div class="w-1/3 flex">
              <a-form-item label="姓名" class="w-1/2">
                <a-input v-model:value="formState.psnName" disabled />
              </a-form-item>
              <a-form-item label="性别" class="w-1/2 px-5">
                <div class="flex items-end">
                  <a-select
                    :ref="(e) => setSubRef(e, 'gend')"
                    v-model:value="formState.gend"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.gendName = '男') : (formState.gendName = '女'))"
                  >
                    <a-select-option value="1">男</a-select-option>
                    <a-select-option value="2">女</a-select-option>
                  </a-select>
                  <!-- <div class="w-[100px] text-gray-400 text-sm text-right">1.男 2.女</div> -->
                </div>
              </a-form-item>
            </div>
            <div class="w-1/3 flex pl-8 pr-4">
              <a-form-item label="出生日期" class="w-3/5 pr-2">
                <!-- <a-input v-model:value="formState.brdy" :disabled="formState.status === 1" /> -->
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'brdy')"
                  v-model:value="formState.brdy"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
              <a-form-item label="年龄" class="w-2/5">
                <a-input :ref="(e) => setSubRef(e, 'age')" v-model:value="formState.age" :suffix="formState.ageUnit" :disabled="formState.status === 1" />
              </a-form-item>
            </div>

            <a-form-item label="国籍" class="w-1/3 pl-5">
              <!-- <a-input v-model:value="formState.nationality" :disabled="formState.status === 1" /> -->
              <SelectItem
                v-model:value="formState.nationalityCode"
                :disabled="formState.status === 1"
                type="DT00004"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.nationalityCode = $event.value
                    formState.nationality = $event.label
                  }
                "
              />
            </a-form-item>
            <a-form-item label="" class="w-1/3">
              <div class="flex items-end w-full">
                <div class="w-[320px]">（年龄不足1周岁的）年龄</div>
                <a-input :ref="(e) => setSubRef(e, 'newmonth')" v-model:value="formState.newmonth" :disabled="formState.status === 1" suffix="月" />
              </div>
            </a-form-item>
            <a-form-item label="新生儿出生体重" class="w-1/3 pl-8 pr-4">
              <a-input :ref="(e) => setSubRef(e, 'nwbBirWt')" v-model:value="formState.nwbBirWt" :disabled="formState.status === 1" suffix="克" />
            </a-form-item>
            <a-form-item label="新生儿入院体重" class="w-1/3 pl-5">
              <a-input :ref="(e) => setSubRef(e, 'nwbAdmWt')" v-model:value="formState.nwbAdmWt" suffix="克" :disabled="formState.status === 1" />
            </a-form-item>
            <a-form-item label="出生地" class="w-1/3 pr-5">
              <SelectAddress :ref="(e) => setSubRef(e, 'birplc')" v-model:value="formState.birplc" :disabled="formState.status === 1" />
              <!-- <a-input v-model:value="formState.birplc" :disabled="formState.status === 1" /> -->
            </a-form-item>
            <a-form-item label="籍贯" class="w-1/3 px-8">
              <SelectAddress :ref="(e) => setSubRef(e, 'napl')" v-model:value="formState.napl" allow-clear :disabled="formState.status === 1" />
              <!-- <a-input v-model:value="formState.napl" :disabled="formState.status === 1" /> -->
            </a-form-item>
            <a-form-item label="民族" class="w-1/3 pl-5">
              <!-- <a-input v-model:value="formState.natyName" :disabled="formState.status === 1" /> -->
              <SelectItem
                v-model:value="formState.naty"
                :disabled="formState.status === 1"
                type="naty"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.naty = $event.value
                    formState.natyName = $event.label
                  }
                "
              />
            </a-form-item>
            <a-form-item label="证件类型" class="w-1/3 pr-5">
              <SelectItem
                v-model:value="formState.certType"
                :disabled="formState.status === 1"
                type="DT00001"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.certType = $event.value
                    formState.certTypeName = $event.label
                  }
                "
              />
            </a-form-item>
            <a-form-item label="身份证号" class="w-1/3 px-8">
              <a-input :ref="(e) => setSubRef(e, 'certno')" v-model:value="formState.certno" :disabled="formState.status === 1" />
            </a-form-item>
            <a-form-item label="职业" class="w-1/3 pl-5">
              <!-- <a-input v-model:value="formState.prfsName" :disabled="formState.status === 1" :ref="(e) => setSubRef(e, 'prfs')" /> -->
              <!-- is-ref
                is-ref-name="prfs"
                @success="(e, name) => setSubRef(e, name)" -->
              <SelectItem
                v-model:value="formState.prfs"
                :disabled="formState.status === 1"
                type="DT00009"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.prfs = $event.value
                    formState.prfsName = $event.label
                  }
                "
              />
            </a-form-item>
            <div class="w-full">
              <a-form-item label="婚姻" class="!w-1/3 pr-5">
                <div class="flex items-end">
                  <SelectItem
                    v-model:value="formState.mrgStas"
                    :disabled="formState.status === 1"
                    type="DT00002"
                    trigger="init"
                    placeholder="请选择"
                    @change="
                      (_, $event) => {
                        formState.mrgStasName = $event.label
                        formState.mrgStas = $event.value
                      }
                    "
                  />
                  <!-- <div class="w-[950px] text-gray-400 text-sm">1.未婚 2.已婚 3.丧偶 4.离婚 5.其他</div> -->
                </div>
              </a-form-item>
            </div>
            <a-form-item label="现地址" class="w-1/3 pr-5">
              <!-- <SelectAddress v-model:value="formState.currAddress" @change="onCurrAddress" /> -->
              <a-select
                :ref="(e) => setSubRef(e, 'currAddrProv')"
                v-model:value="formState.currAddrProv"
                class="!w-2/6"
                placeholder="请选择省"
                :show-arrow="false"
                :disabled="formState.status === 1"
                allow-clear
                @change="selectAddres($event, 'province', 1)"
              >
                <a-select-option v-for="(item, index) in provinceListOne" :key="index" :value="item.province">{{ item.province }}</a-select-option>
              </a-select>
              <a-select
                :ref="(e) => setSubRef(e, 'currAddrCity')"
                v-model:value="formState.currAddrCity"
                class="!w-2/6 px-3"
                placeholder="请选择市"
                :show-arrow="false"
                :disabled="formState.status === 1 || !formState.currAddrProv"
                allow-clear
                @change="selectAddres($event, 'city', 1)"
              >
                <a-select-option v-for="(item, index) in cityListOne" :key="index" :value="item.city">{{ item.city }}</a-select-option>
              </a-select>
              <a-select
                :ref="(e) => setSubRef(e, 'currAddrCoty')"
                v-model:value="formState.currAddrCoty"
                class="!w-2/6"
                placeholder="请选择区"
                :show-arrow="false"
                :disabled="formState.status === 1 || !formState.currAddrProv || !formState.currAddrCity"
                allow-clear
              >
                <a-select-option v-for="(item, index) in countyListOne" :key="index" :value="item.county">{{ item.county }}</a-select-option>
              </a-select>
            </a-form-item>
            <div class="w-4/6 flex pl-5">
              <a-form-item label="详细地址" class="w-2/4">
                <a-input :ref="(e) => setSubRef(e, 'currAddr')" v-model:value="formState.currAddr" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="电话" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'addressPhone')" v-model:value="formState.addressPhone" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="邮编" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'currAddrPoscode')" v-model:value="formState.currAddrPoscode" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <a-form-item label="户口地址" class="w-1/3 pr-5">
              <!-- <SelectAddress v-model:value="formState.resdAddress" @change="onResdAddress" /> -->
              <a-select
                :ref="(e) => setSubRef(e, 'resdAddrProv')"
                v-model:value="formState.resdAddrProv"
                class="!w-2/6"
                placeholder="请选择省"
                :show-arrow="false"
                :disabled="formState.status === 1"
                allow-clear
                @change="selectAddres($event, 'province', 2)"
              >
                <a-select-option v-for="(item, index) in provinceListTwo" :key="index" :value="item.province">{{ item.province }}</a-select-option>
              </a-select>
              <a-select
                :ref="(e) => setSubRef(e, 'resdAddrCity')"
                v-model:value="formState.resdAddrCity"
                class="!w-2/6 px-3"
                placeholder="请选择市"
                :show-arrow="false"
                :disabled="formState.status === 1 || !formState.resdAddrProv"
                allow-clear
                @change="selectAddres($event, 'city', 2)"
              >
                <a-select-option v-for="(item, index) in cityListTwo" :key="index" :value="item.city">{{ item.city }}</a-select-option>
              </a-select>
              <a-select
                :ref="(e) => setSubRef(e, 'resdAddrCoty')"
                v-model:value="formState.resdAddrCoty"
                class="!w-2/6"
                placeholder="请选择区"
                :show-arrow="false"
                :disabled="formState.status === 1 || !formState.resdAddrProv || !formState.resdAddrCity"
                allow-clear
              >
                <a-select-option v-for="(item, index) in countyListTwo" :key="index" :value="item.county">{{ item.county }}</a-select-option>
              </a-select>
            </a-form-item>
            <div class="w-4/6 flex pl-5">
              <a-form-item label="详细地址" class="w-3/4">
                <a-input :ref="(e) => setSubRef(e, 'resdAddr')" v-model:value="formState.resdAddr" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="邮编" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'resdAddrPoscode')" v-model:value="formState.resdAddrPoscode" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <a-form-item label="工作单位及地址" class="w-1/3 pr-5">
              <a-input :ref="(e) => setSubRef(e, 'emprAddr')" v-model:value="formState.emprAddr" :disabled="formState.status === 1" />
            </a-form-item>
            <div class="w-4/6 flex pl-5">
              <a-form-item label="单位名称" class="w-2/4">
                <a-input :ref="(e) => setSubRef(e, 'emprName')" v-model:value="formState.emprName" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="单位电话" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'emprTel')" v-model:value="formState.emprTel" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="邮编" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'emprPoscode')" v-model:value="formState.emprPoscode" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <div class="flex w-1/3 pr-14">
              <a-form-item label="联系人姓名" class="w-1/2">
                <a-input :ref="(e) => setSubRef(e, 'conerName')" v-model:value="formState.conerName" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="关系" class="w-1/2">
                <!-- <a-input v-model:value="formState.conerRltsCode" :disabled="formState.status === 1" /> -->
                <SelectItem
                  v-model:value="formState.conerRltsCode"
                  :disabled="formState.status === 1"
                  type="DT00008"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.conerRltsCode = $event.value
                      formState.conerRltsName = $event.label
                    }
                  "
                />
              </a-form-item>
            </div>
            <div class="w-4/6 flex pl-5">
              <!-- 联系人地址 -->
              <a-form-item label="地址" class="w-2/4">
                <!-- <SelectAddress v-model:value="formState.conerAddress" @change="onConerAddress" /> -->
                <a-select
                  :ref="(e) => setSubRef(e, 'conerAddrProv')"
                  v-model:value="formState.conerAddrProv"
                  class="!w-2/6"
                  placeholder="请选择省"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                  allow-clear
                  @change="selectAddres($event, 'province', 3)"
                >
                  <a-select-option v-for="(item, index) in provinceListThree" :key="index" :value="item.province">{{ item.province }}</a-select-option>
                </a-select>
                <a-select
                  :ref="(e) => setSubRef(e, 'conerAddrCity')"
                  v-model:value="formState.conerAddrCity"
                  class="!w-2/6 px-2"
                  placeholder="请选择市"
                  :show-arrow="false"
                  :disabled="formState.status === 1 || !formState.conerAddrProv"
                  allow-clear
                  @change="selectAddres($event, 'city', 3)"
                >
                  <a-select-option v-for="(item, index) in cityListThree" :key="index" :value="item.city">{{ item.city }}</a-select-option>
                </a-select>
                <a-select
                  :ref="(e) => setSubRef(e, 'conerAddrCoty')"
                  v-model:value="formState.conerAddrCoty"
                  class="!w-2/6"
                  placeholder="请选择区"
                  :show-arrow="false"
                  :disabled="formState.status === 1 || !formState.conerAddrProv || !formState.conerAddrCity"
                  allow-clear
                >
                  <a-select-option v-for="(item, index) in countyListThree" :key="index" :value="item.county">{{ item.county }}</a-select-option>
                </a-select>
              </a-form-item>
              <a-form-item label="详细地址" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'conerAddr')" v-model:value="formState.conerAddr" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="电话" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'conerTel')" v-model:value="formState.conerTel" :disabled="formState.status === 1" />
              </a-form-item>
            </div>

            <BaseTitle id="tab2" title="住院信息" class="-ml-8" />

            <a-form-item label="入院途径" class="w-1/3 pr-5">
              <SelectItem
                v-model:value="formState.admWayCode"
                type="DT00013"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.admWayName = $event.label
                    formState.admWayCode = $event.value
                  }
                "
              />
              <!-- <div class="flex items-end">
            <a-select v-model:value="formState.admWayCode" placeholder="请选择" :show-arrow="false" :disabled="formState.status === 1">
              <a-select-option value="1">急诊</a-select-option>
              <a-select-option value="2">门诊</a-select-option>
              <a-select-option value="3">其他医疗机构转入</a-select-option>
              <a-select-option value="4">其他</a-select-option>
            </a-select>
            <div class="text-gray-400 text-sm w-[700px]">1.急诊 2.门诊 3.其他医疗机构转入 4.其他</div>
          </div> -->
            </a-form-item>
            <div class="w-4/6 flex pl-5">
              <a-form-item label="住院疑难" class="w-1/3">
                <div class="flex items-end">
                  <!-- @focus="onFocusChange" -->
                  <!-- :open="openSelect" -->
                  <a-select
                    :ref="(e) => setSubRef(e, 'isDiffcultProblem')"
                    v-model:value="formState.isDiffcultProblem"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.isDiffcultProblemName = '是') : (formState.isDiffcultProblemName = '否'))"
                  >
                    <a-select-option value="1">是</a-select-option>
                    <a-select-option value="2">否</a-select-option>
                  </a-select>
                  <!-- <div class="text-gray-400 text-sm w-[150px]">1.是 2.否</div> -->
                </div>
              </a-form-item>
              <a-form-item label="住院危重" class="w-1/3 text-left">
                <div class="flex items-end">
                  <a-select
                    :ref="(e) => setSubRef(e, 'isCriticallyIll')"
                    v-model:value="formState.isCriticallyIll"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.isCriticallyIllName = '是') : (formState.isCriticallyIllName = '否'))"
                  >
                    <a-select-option value="1">是</a-select-option>
                    <a-select-option value="2">否</a-select-option>
                  </a-select>
                  <!-- <div class="text-gray-400 text-sm w-[70px]">1.是 2.否</div> -->
                </div>
              </a-form-item>
              <a-form-item label="住院急症" class="w-1/3">
                <div class="flex items-end">
                  <a-select
                    :ref="(e) => setSubRef(e, 'isEmergency')"
                    v-model:value="formState.isEmergency"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.isEmergencyName = '是') : (formState.isEmergencyName = '否'))"
                  >
                    <a-select-option value="1">是</a-select-option>
                    <a-select-option value="2">否</a-select-option>
                  </a-select>
                  <!-- <div class="text-gray-400 text-sm w-[70px]">1.是 2.否</div> -->
                </div>
              </a-form-item>
            </div>
            <a-form-item label="入院时间" class="w-1/3 pr-5">
              <div class="flex">
                <a-input :value="formatTimes(formState.admDate, 'date')" disabled />
                <a-input :value="formatTimes(formState.admDate, 'time')" class="ml-2" disabled />
              </div>
            </a-form-item>
            <!-- <a-form-item label="" class="w-1/4">
          <a-input v-model:value="formState.checkinTime" :disabled="formState.status === 1" />
        </a-form-item> -->
            <div class="w-4/6 flex pl-5">
              <a-form-item label="病人来源" class="w-1/3">
                <a-input :ref="(e) => setSubRef(e, 'patientSource')" v-model:value="formState.patientSource" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="入院后确诊日期" class="w-1/3">
                <!-- <a-input v-model:value="formState.cnfmDate" :disabled="formState.status === 1" /> -->
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'cnfmDate')"
                  v-model:value="formState.cnfmDate"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
            </div>
            <a-form-item label="入院科别" class="w-1/3 pr-5">
              <a-input v-model:value="formState.admCatyName" disabled />
            </a-form-item>
            <div class="w-4/6 flex pl-5">
              <a-form-item label="病房" class="w-1/3">
                <a-input :ref="(e) => setSubRef(e, 'admWard')" v-model:value="formState.admWard" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="是否特需病人" class="w-1/3">
                <div class="flex items-end">
                  <a-select
                    :ref="(e) => setSubRef(e, 'isSpecial')"
                    v-model:value="formState.isSpecial"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.isSpecialName = '是') : (formState.isSpecialName = '否'))"
                  >
                    <a-select-option value="1">是</a-select-option>
                    <a-select-option value="2">否</a-select-option>
                  </a-select>
                  <!-- <div class="text-gray-400 text-sm w-[65px]">1.是 2.否</div> -->
                </div>
              </a-form-item>
              <a-form-item label="转科科别" class="w-1/3">
                <a-input :ref="(e) => setSubRef(e, 'refldeptCatyName')" v-model:value="formState.refldeptCatyName" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <a-form-item label="出院时间" class="w-1/3 pr-5">
              <div class="flex">
                <!-- :allow-clear="false" -->
                <!-- <a-input :value="formatTimes(formState.dscgDate, 'date')" /> -->
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'dscgDateYear')"
                  v-model:value="formState.dscgDateYear"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  :disabled="formState.status === 1"
                />
                <!-- <a-input :value="formatTimes(formState.dscgDate, 'time')" class="ml-2" /> -->
                <a-time-picker
                  :ref="(e) => setSubRef(e, 'dscgDateMonth')"
                  v-model:value="formState.dscgDateMonth"
                  format="HH:mm:ss"
                  value-format="HH:mm:ss"
                  class="ml-2"
                  :disabled="formState.status === 1"
                />
              </div>
            </a-form-item>
            <!-- <a-form-item label="" class="w-1/5">
          <a-input v-model:value="formState.checkoutTime" :disabled="formState.status === 1" />
        </a-form-item> -->
            <div class="w-4/6 flex pl-5">
              <a-form-item label="出院科别" class="w-1/3">
                <a-input v-model:value="formState.dscgCatyName" placeholder="请输入" disabled />
              </a-form-item>
              <a-form-item label="病房" class="w-1/3">
                <a-input :ref="(e) => setSubRef(e, 'dscgWard')" v-model:value="formState.dscgWard" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="" class="w-1/3">
                <div class="flex items-end">
                  <div class="!w-[100px]">实际住院</div>
                  <a-input :ref="(e) => setSubRef(e, 'iptDays')" v-model:value="formState.iptDays" :disabled="formState.status === 1" />
                  <span>天</span>
                </div>
              </a-form-item>
            </div>
            <a-form-item label="门(急)诊诊断" class="w-3/5 pr-3">
              <a-input v-model:value="formState.mzzdmc" disabled />
            </a-form-item>
            <a-form-item label="疾病编码" class="w-2/5">
              <a-input v-model:value="formState.mzzddm" disabled />
            </a-form-item>
            <a-form-item label="入院诊断" class="w-3/5 pr-3">
              <a-input v-model:value="formState.ryzdmc" disabled />
            </a-form-item>
            <a-form-item label="疾病编码" class="w-2/5">
              <a-input v-model:value="formState.ryzddm" disabled />
            </a-form-item>

            <BaseTitle id="tab3" title="诊断信息" class="-ml-8" />
            <div class="py-2 px-6 w-full">
              <TabDispose is-medical-record :is-medical-inplsh="inplsh" :is-submit="formState.status === 1" />
              <!-- diagnosisInfoList  formState.cyzd -->
              <!-- <BaseTable key="id" :columns="diagnosisColumns" :data-source="formState.cyzd" size="small" bordered :heigth="600">
              <template #bodyCell="{ column, record }">
                <template v-if="column.dataIndex === 'checkinConditionCode'">
                  <EditCell title="入院病情">
                    <a-select v-model:value="record.checkinConditionCode" class="table-select" allow-clear :show-arrow="false" placeholder="请选择">
                      <a-select-option value="1"> 有 </a-select-option>
                      <a-select-option value="2"> 临床未确定 </a-select-option>
                      <a-select-option value="3"> 情况不明 </a-select-option>
                      <a-select-option value="4"> 无 </a-select-option>
                    </a-select>
                  </EditCell>
                </template>
                <template v-if="column.dataIndex === 'checkoutConditionCode'">
                  <EditCell title="出院情况">
                    <a-select v-model:value="record.checkoutConditionCode" class="table-select" allow-clear :show-arrow="false" placeholder="请选择">
                      <a-select-option value="1"> 治愈 </a-select-option>
                      <a-select-option value="2"> 好转 </a-select-option>
                      <a-select-option value="3"> 未愈 </a-select-option>
                      <a-select-option value="4"> 死亡 </a-select-option>
                      <a-select-option value="5"> 其他 </a-select-option>
                    </a-select>
                  </EditCell>
                </template>
              </template>
              <template #footer
                >入院病情：<span class="mr-5">1.有</span> <span class="mr-5">2.临床未确定</span><span class="mr-5"> 3.情况不明</span
                ><span class="mr-5">4.无</span> <span class="mx-2"></span> 出院情况： <span class="mr-5">1.治愈</span> <span class="mr-5">2.好转</span>
                <span class="mr-5">3.未愈</span> <span class="mr-5">4.死亡</span> <span class="mr-5">5.其他</span>
              </template>
            </BaseTable> -->
            </div>

            <a-form-item label="损伤、中毒的外部原因" class="w-3/5 pr-3">
              <!-- <a-input v-model:value="formState.damgIntxExtRea" :disabled="formState.status === 1" /> -->
              <SelectTable
                v-model:value="formState.damgIntxExtRea"
                type="诊断"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.damgIntxExtRea = event.zdmc
                    formState.damgIntxExtReaDisecode = event.zddm
                  }
                "
              />
            </a-form-item>
            <a-form-item label="疾病编码" class="w-2/5">
              <a-input v-model:value="formState.damgIntxExtReaDisecode" disabled />
            </a-form-item>
            <a-form-item label="病理诊断" class="w-3/5 pr-3">
              <!-- <a-input v-model:value="formState.pathDiaName" disabled /> -->
              <SelectTable
                v-model:value="formState.pathDiaName"
                type="诊断"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.pathDiaName = event.zdmc
                    formState.pathDiaCode = event.zddm
                  }
                "
              />
            </a-form-item>
            <a-form-item label="疾病编码" class="w-2/5">
              <a-input v-model:value="formState.pathDiaCode" disabled />
            </a-form-item>

            <a-form-item label="病理描述" class="w-3/5 pr-3">
              <a-input :ref="(e) => setSubRef(e, 'pathDiaDescription')" v-model:value="formState.pathDiaDescription" :disabled="formState.status === 1" />
              <!-- <SelectTable
                v-model:value="formState.pathDiaName1"
                type="诊断"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.pathDiaName1 = event.zdmc
                    formState.pathDiaCode1 = event.zddm
                  }
                "
              /> -->
            </a-form-item>
            <a-form-item label="病理号" class="w-2/5">
              <a-input :ref="(e) => setSubRef(e, 'palgNo')" v-model:value="formState.palgNo" :disabled="formState.status === 1" />
            </a-form-item>

            <div class="w-3/5 flex pr-3">
              <a-form-item label="药物过敏" class="w-1/5">
                <div class="flex items-end pr-5">
                  <a-select
                    :ref="(e) => setSubRef(e, 'drugDicmFlag')"
                    v-model:value="formState.drugDicmFlag"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.drugDicmFlagName = '无') : (formState.drugDicmFlagName = '有'))"
                  >
                    <a-select-option value="1">无</a-select-option>
                    <a-select-option value="2">有</a-select-option>
                  </a-select>
                  <!-- <div class="text-gray-400 text-sm w-[100px]">1.无 2.有</div> -->
                </div>
              </a-form-item>
              <a-form-item label="过敏药物" class="w-4/5">
                <!-- 过敏史  v-model:value="formState.dicmDrugName" -->
                <SelectAllergyModal
                  v-model:value="formState.dicmDrugName"
                  :source-data="formState.patientAllergys"
                  :br-id="formState.brId"
                  :disabled="formState.status === 1"
                  @success="formState.patientAllergys = $event.data"
                />
                <!-- <a-input v-model:value="formState.dicmDrugName" :disabled="formState.status === 1" @click="onFocus" /> -->
              </a-form-item>
            </div>

            <a-form-item label="死亡患者尸检" class="w-2/5">
              <div class="flex items-end">
                <a-select
                  :ref="(e) => setSubRef(e, 'dieAutpFlag')"
                  v-model:value="formState.dieAutpFlag"
                  placeholder="请选择"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                  @change="(value) => (value === '1' ? (formState.dieAutpFlagName = '是') : (formState.dieAutpFlagName = '否'))"
                >
                  <a-select-option value="1">是</a-select-option>
                  <a-select-option value="0">否</a-select-option>
                </a-select>
                <!-- <div class="text-gray-400 text-sm w-[65px]">1.是 2.否</div> -->
              </div>
            </a-form-item>

            <div class="w-full flex">
              <div class="w-3/5 flex">
                <a-form-item class="w-1/5">
                  <div class="flex items-end">
                    <div class="w-[80px]">抢救</div>
                    <a-input :ref="(e) => setSubRef(e, 'rescCnt')" v-model:value="formState.rescCnt" :disabled="formState.status === 1" />
                    <div class="text-gray-400 text-sm w-[75px]">次</div>
                  </div>
                </a-form-item>
                <a-form-item label="成功" class="w-1/5">
                  <a-input :ref="(e) => setSubRef(e, 'rescSuccCnt')" v-model:value="formState.rescSuccCnt" suffix="次" :disabled="formState.status === 1" />
                </a-form-item>
              </div>
              <!-- 临床路径管理 -->
              <a-form-item label="临床路径管理" class="w-2/5">
                <SelectItem
                  v-model:value="formState.clinicalPathwayCode"
                  :disabled="formState.status === 1"
                  type="DT00312"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.clinicalPathwayCode = $event.value
                      formState.clinicalPathwayName = $event.label
                    }
                  "
                />
              </a-form-item>
            </div>

            <div class="w-full flex">
              <div class="w-3/5 flex">
                <a-form-item label="血型" class="w-1/5">
                  <div class="flex items-end">
                    <!-- <a-select v-model:value="formState.aboCode" placeholder="请选择" :show-arrow="false" :disabled="formState.status === 1">
                    <a-select-option value="1">A</a-select-option>
                    <a-select-option value="2">B</a-select-option>
                    <a-select-option value="3">O</a-select-option>
                    <a-select-option value="4">AB</a-select-option>
                    <a-select-option value="5">不详</a-select-option>
                    <a-select-option value="6">未查</a-select-option>
                  </a-select> -->
                    <!-- <div class="text-gray-400 text-sm w-[380px]">1.A 2.B 3.O 4.AB 5.不详 6.未查</div> -->
                    <SelectItem
                      v-model:value="formState.aboCode"
                      :disabled="formState.status === 1"
                      type="DT00006"
                      trigger="init"
                      style-class="!w-[80px]"
                      placeholder="请选择"
                      @change="
                        (_, $event) => {
                          formState.aboCode = $event.value
                          formState.aboName = $event.label
                        }
                      "
                    />
                  </div>
                </a-form-item>
                <a-form-item label="RH" class="w-1/5 mr-5">
                  <div class="flex items-end">
                    <!-- <a-select v-model:value="formState.rhCode" placeholder="请选择" :show-arrow="false" :disabled="formState.status === 1">
                    <a-select-option value="1">阴</a-select-option>
                    <a-select-option value="2">阳</a-select-option>
                    <a-select-option value="3">不详</a-select-option>
                    <a-select-option value="4">未查</a-select-option>
                  </a-select> -->
                    <!-- <div class="text-gray-400 text-sm w-[200px]">1.阴 2.阳 3.不详 4.未查</div> -->
                    <SelectItem
                      v-model:value="formState.rhCode"
                      :disabled="formState.status === 1"
                      type="DT00007"
                      trigger="init"
                      style-class="!w-[90px]"
                      placeholder="请选择"
                      @change="
                        (_, $event) => {
                          formState.rhCode = $event.value
                          formState.rhName = $event.label
                        }
                      "
                    />
                  </div>
                </a-form-item>
                <a-form-item label="输血反应" class="w-1/4">
                  <div class="flex items-end">
                    <a-select
                      :ref="(e) => setSubRef(e, 'bldtrnCode')"
                      v-model:value="formState.bldtrnCode"
                      placeholder="请选择"
                      :show-arrow="false"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.bldtrnName = '有') : (formState.bldtrnName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                    <!-- <div class="text-gray-400 text-sm w-[60px]">1.有 2.无</div> -->
                  </div>
                </a-form-item>
              </div>
            </div>
            <template v-if="getSystemConfig('IS_INP_OB_GYN') === '1'">
              <a-form-item label="妊娠梅毒筛查" class="w-1/5">
                <div class="flex items-end">
                  <a-select
                    :ref="(e) => setSubRef(e, 'sypPreScr')"
                    v-model:value="formState.sypPreScr"
                    placeholder="请选择"
                    :show-arrow="false"
                    :disabled="formState.status === 1"
                    @change="(value) => (value === '1' ? (formState.sypPreScrName = '有') : (formState.sypPreScrName = '无'))"
                  >
                    <a-select-option value="1">有</a-select-option>
                    <a-select-option value="2">无</a-select-option>
                  </a-select>
                  <!-- <div class="text-gray-400 text-sm w-[410px]">1.有 2.无</div> -->
                </div>
              </a-form-item>
              <a-form-item label="新生儿疾病筛查" class="w-4/5 pl-12">
                <div class="flex items-end">
                  <div class="flex items-end">
                    CH
                    <a-select
                      :ref="(e) => setSubRef(e, 'neoDisScrCh')"
                      v-model:value="formState.neoDisScrCh"
                      placeholder="请选择"
                      :show-arrow="false"
                      class="!w-24"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.neoDisScrChName = '有') : (formState.neoDisScrChName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                  </div>
                  <div class="flex items-end">
                    PKU
                    <a-select
                      :ref="(e) => setSubRef(e, 'neoDisScrPku')"
                      v-model:value="formState.neoDisScrPku"
                      placeholder="请选择"
                      :show-arrow="false"
                      class="!w-24"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.neoDisScrPkuName = '有') : (formState.neoDisScrPkuName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                  </div>
                  <div class="flex items-end">
                    CAH
                    <a-select
                      :ref="(e) => setSubRef(e, 'neoDisScrCah')"
                      v-model:value="formState.neoDisScrCah"
                      placeholder="请选择"
                      :show-arrow="false"
                      class="!w-24"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.neoDisScrCahName = '有') : (formState.neoDisScrCahName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                  </div>
                  <div class="flex items-end">
                    GD6P
                    <a-select
                      :ref="(e) => setSubRef(e, 'neoDisScrGd6p')"
                      v-model:value="formState.neoDisScrGd6p"
                      placeholder="请选择"
                      :show-arrow="false"
                      class="!w-24"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.neoDisScrGd6pName = '有') : (formState.neoDisScrGd6pName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                  </div>
                  <div class="flex items-end">
                    听力
                    <a-select
                      :ref="(e) => setSubRef(e, 'neoDisScrTl')"
                      v-model:value="formState.neoDisScrTl"
                      placeholder="请选择"
                      :show-arrow="false"
                      class="!w-24"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.neoDisScrTlName = '有') : (formState.neoDisScrTlName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                  </div>
                  <!-- <div class="text-gray-400 text-sm w-[300px]">1.有 2.无</div> -->
                </div>
              </a-form-item>
              <div class="w-1/3 flex">
                <a-form-item label="产后出血" class="w-1/2 pr-5">
                  <div class="flex items-end">
                    <a-select
                      :ref="(e) => setSubRef(e, 'posHem')"
                      v-model:value="formState.posHem"
                      placeholder="请选择"
                      :show-arrow="false"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.posHemName = '有') : (formState.posHemName = '无'))"
                    >
                      <a-select-option value="1">有</a-select-option>
                      <a-select-option value="2">无</a-select-option>
                    </a-select>
                    <!-- <div class="text-gray-400 text-sm w-[300px]">1.有 2.无</div> -->
                  </div>
                </a-form-item>
                <a-form-item label="新生儿性别" class="w-1/2">
                  <div class="flex items-end">
                    <a-select
                      :ref="(e) => setSubRef(e, 'newbornsex')"
                      v-model:value="formState.newbornsex"
                      placeholder="请选择"
                      :show-arrow="false"
                      :disabled="formState.status === 1"
                      @change="(value) => (value === '1' ? (formState.newbornsexName = '男') : (formState.newbornsexName = '女'))"
                    >
                      <a-select-option value="1">男</a-select-option>
                      <a-select-option value="2">女</a-select-option>
                    </a-select>
                    <!-- <div class="text-gray-400 text-sm w-[155px]">1.男 2.女</div> -->
                  </div>
                </a-form-item>
                <!-- <a-form-item label="体重" class="w-1/4">
            <a-input v-model:value="formState.weight" :disabled="formState.status === 1">
              <template #suffix> <span class="text-gray-400">g</span> </template>
            </a-input>
          </a-form-item> -->
              </div>
            </template>

            <a-divider class="my-2" dashed />
            <a-form-item label="科主任" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.deptdrtName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.deptdrtName = event.empName
                    formState.deptdrtCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="主任(副主任)医师" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.chfdrName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.chfdrName = event.empName
                    formState.chfdrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="主治医师" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.atddrName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.atddrName = event.empName
                    formState.atddrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="住院医师" class="w-1/4">
              <SelectTable
                v-model:value="formState.iptDrName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.iptDrName = event.empName
                    formState.iptDrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="责任护士" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.respNursName"
                type="护士"
                :search-params="{ emplbid: '2' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.respNursName = event.empName
                    formState.respNursCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="进修医师" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.trainDrName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.trainDrName = event.empName
                    formState.trainDrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="实习医师" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.intnDrName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.intnDrName = event.empName
                    formState.intnDrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="编码员" class="w-1/4">
              <SelectTable
                v-model:value="formState.codrName"
                type="员工"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.codrName = event.empName
                    formState.codrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="病案质量" class="w-1/4 pr-5">
              <div class="flex items-end">
                <a-select
                  :ref="(e) => setSubRef(e, 'medcasQltCode')"
                  v-model:value="formState.medcasQltCode"
                  placeholder="请选择"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                  @change="
                    (value) =>
                      value === '1' ? (formState.medcasQltName = '甲') : value === '2' ? (formState.medcasQltName = '乙') : (formState.medcasQltName = '丙')
                  "
                >
                  <a-select-option value="1">甲</a-select-option>
                  <a-select-option value="2">乙</a-select-option>
                  <a-select-option value="3">丙</a-select-option>
                </a-select>
                <!-- <div class="text-gray-400 text-sm w-[120px]">1.甲 2.乙 3.丙</div> -->
              </div>
            </a-form-item>
            <a-form-item label="质控医师" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.qltctrlDrName"
                type="医生"
                :search-params="{ emplbid: '1' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.qltctrlDrName = event.empName
                    formState.qltctrlDrCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="质控护士" class="w-1/4 pr-5">
              <SelectTable
                v-model:value="formState.qltctrlNursName"
                type="护士"
                :search-params="{ emplbid: '2' }"
                :disabled="formState.status === 1"
                @select="
                  (event) => {
                    formState.qltctrlNursName = event.empName
                    formState.qltctrlNursCode = event.empId
                  }
                "
              />
            </a-form-item>
            <a-form-item label="质控日期" class="w-1/4">
              <!-- <a-input v-model:value="formState.qltctrlDate" :disabled="formState.status === 1" /> -->
              <a-date-picker
                :ref="(e) => setSubRef(e, 'qltctrlDate')"
                v-model:value="formState.qltctrlDate"
                format="YYYY-MM-DD"
                value-format="YYYY-MM-DD"
                :disabled="formState.status === 1"
              />
            </a-form-item>

            <!-- 手术信息 -->
            <OperationTable :params="formState" :inplsh="inplsh" />

            <a-form-item label="诊断符合情况：门诊与出院" class="w-1/4">
              <a-select
                :ref="(e) => setSubRef(e, 'isConformOutpInp')"
                v-model:value="formState.isConformOutpInp"
                placeholder="请选择"
                :show-arrow="false"
                :disabled="formState.status === 1"
              >
                <a-select-option value="0">未做</a-select-option>
                <a-select-option value="1">符合</a-select-option>
                <a-select-option value="2">不符合</a-select-option>
                <a-select-option value="3">不肯定</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="入院与出院" class="w-1/6 pl-2">
              <a-select
                :ref="(e) => setSubRef(e, 'isConformCheckinOut')"
                v-model:value="formState.isConformCheckinOut"
                placeholder="请选择"
                :show-arrow="false"
                :disabled="formState.status === 1"
              >
                <a-select-option value="0">未做</a-select-option>
                <a-select-option value="1">符合</a-select-option>
                <a-select-option value="2">不符合</a-select-option>
                <a-select-option value="3">不肯定</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="术前与术后" class="w-1/6">
              <a-select
                :ref="(e) => setSubRef(e, 'isConformOpr')"
                v-model:value="formState.isConformOpr"
                placeholder="请选择"
                :show-arrow="false"
                :disabled="formState.status === 1"
              >
                <a-select-option value="0">未做</a-select-option>
                <a-select-option value="1">符合</a-select-option>
                <a-select-option value="2">不符合</a-select-option>
                <a-select-option value="3">不肯定</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="临床与病理" class="w-1/6">
              <a-select
                :ref="(e) => setSubRef(e, 'isConformClinical')"
                v-model:value="formState.isConformClinical"
                placeholder="请选择"
                :show-arrow="false"
                :disabled="formState.status === 1"
              >
                <a-select-option value="0">未做</a-select-option>
                <a-select-option value="1">符合</a-select-option>
                <a-select-option value="2">不符合</a-select-option>
                <a-select-option value="3">不肯定</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="放射与病理" class="w-1/6">
              <div class="flex items-end">
                <a-select
                  :ref="(e) => setSubRef(e, 'isConformRisPathology')"
                  v-model:value="formState.isConformRisPathology"
                  placeholder="请选择"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                >
                  <a-select-option value="0">未做</a-select-option>
                  <a-select-option value="1">符合</a-select-option>
                  <a-select-option value="2">不符合</a-select-option>
                  <a-select-option value="3">不肯定</a-select-option>
                </a-select>
                <!-- <div class="text-gray-400 text-sm w-[500px]">0.未做 1.符合 2.不符合 3.不肯定</div> -->
              </div>
            </a-form-item>

            <a-form-item label="离院方式" class="w-1/4">
              <div class="flex items-end">
                <!-- <a-select
                v-model:value="formState.dscgWay"
                class=""
                placeholder="请选择"
                :show-arrow="false"
                :disabled="formState.status === 1"
                @change="onCahngeWay"
              >
                <a-select-option value="1">医嘱离院</a-select-option>
                <a-select-option value="2">医瞩转院</a-select-option>
                <a-select-option value="3">医瞩转社区卫生服务机构/乡镇卫生院</a-select-option>
                <a-select-option value="4">非医嘱死亡</a-select-option>
                <a-select-option value="5">死亡</a-select-option>
                <a-select-option value="6">其他</a-select-option>
              </a-select> -->
                <!-- <div class="text-gray-400 text-sm w-[200px]">1.医嘱离院 2.医瞩转院</div> -->
                <SelectItem
                  v-model:value="formState.dscgWay"
                  :disabled="formState.status === 1"
                  type="DT00031"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.dscgWay = $event.value
                      formState.dscgWayName = $event.label
                    }
                  "
                />
              </div>
            </a-form-item>

            <a-form-item label="拟接收医疗机构名称" class="w-3/4">
              <div class="flex items-center">
                <a-input :ref="(e) => setSubRef(e, 'destOrgNameAdv')" v-model:value="formState.destOrgNameAdv" :disabled="formState.status === 1" />
                <!-- <div class="text-gray-400 text-sm w-[330px]">3.医瞩转社区卫生服务机构/乡镇卫生院</div> -->
              </div>
            </a-form-item>

            <!-- <a-form-item label="拟接收医疗机构名称" class="w-full">
        <div class="flex items-center">
          <a-input v-model:value="formState.destOrgNameHos" class="w-1/2" :disabled="formState.status === 1" />
          <div class="text-gray-400 text-sm w-[300px]">4.非医嘱死亡 5.死亡 6.其他</div>
        </div>
      </a-form-item> -->
            <a-form-item label="是否有出院31天内再住院计划" class="w-1/4">
              <div class="flex items-end">
                <a-select
                  :ref="(e) => setSubRef(e, 'dscgDays31RinpFlag')"
                  v-model:value="formState.dscgDays31RinpFlag"
                  placeholder="请选择"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                  @change="(value) => (value === '1' ? (formState.dscgDays31RinpFlagName = '无') : (formState.dscgDays31RinpFlagName = '有'))"
                >
                  <a-select-option value="1">无</a-select-option>
                  <a-select-option value="2">有</a-select-option>
                </a-select>
                <!-- <div class="text-gray-400 text-sm w-[200px]">1.有 2.无</div> -->
              </div>
            </a-form-item>
            <a-form-item label="目的" class="w-3/4">
              <a-input :ref="(e) => setSubRef(e, 'dscgDays31RinpPup')" v-model:value="formState.dscgDays31RinpPup" :disabled="formState.status === 1" />
            </a-form-item>
            <div class="w-full flex items-center">
              <a-form-item label="颅脑损伤患者昏迷时间：入院前" class="w-1/2">
                <div class="flex">
                  <a-input
                    :ref="(e) => setSubRef(e, 'brnDamgBfadmComaDuraDay')"
                    v-model:value="formState.brnDamgBfadmComaDuraDay"
                    suffix="天"
                    :disabled="formState.status === 1"
                    class="w-[200px] mr-3"
                  />
                  <a-input
                    :ref="(e) => setSubRef(e, 'brnDamgBfadmComaDuraHour')"
                    v-model:value="formState.brnDamgBfadmComaDuraHour"
                    suffix="小时"
                    :disabled="formState.status === 1"
                    class="w-[200px] mr-3"
                  />
                  <a-input
                    :ref="(e) => setSubRef(e, 'brnDamgBfadmComaDuraMin')"
                    v-model:value="formState.brnDamgBfadmComaDuraMin"
                    suffix="分钟"
                    :disabled="formState.status === 1"
                    class="w-[200px] mr-3"
                  />
                </div>
              </a-form-item>
              <a-form-item label="入院后" class="w-1/3 ml-6">
                <div class="flex">
                  <a-input
                    :ref="(e) => setSubRef(e, 'brnDamgAfadmComaDuraDay')"
                    v-model:value="formState.brnDamgAfadmComaDuraDay"
                    suffix="天"
                    :disabled="formState.status === 1"
                    class="w-[130px] mr-3"
                  />
                  <a-input
                    :ref="(e) => setSubRef(e, 'brnDamgAfadmComaDuraHour')"
                    v-model:value="formState.brnDamgAfadmComaDuraHour"
                    suffix="小时"
                    :disabled="formState.status === 1"
                    class="w-[130px] mr-3"
                  />
                  <a-input
                    :ref="(e) => setSubRef(e, 'brnDamgAfadmComaDuraMin')"
                    v-model:value="formState.brnDamgAfadmComaDuraMin"
                    suffix="分钟"
                    :disabled="formState.status === 1"
                    class="w-[130px]"
                  />
                </div>
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="呼吸机使用时间" class="w-1/6 mr-3">
                <a-input
                  :ref="(e) => setSubRef(e, 'ventUsedDura')"
                  v-model:value="formState.ventUsedDura"
                  suffix="小时"
                  :disabled="formState.status === 1"
                  class="w-[100px]"
                />
              </a-form-item>
              <a-form-item label="主要诊断治愈好转情况" class="w-1/3 ml-6">
                <SelectItem
                  v-model:value="formState.recoveryStatusCode"
                  :disabled="formState.status === 1"
                  type="DT00313"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.recoveryStatusCode = $event.value
                      formState.recoveryStatusName = $event.label
                    }
                  "
                />
              </a-form-item>
            </div>

            <div class="flex mb-5">
              <BaseTitle id="tab5" title="费用信息" class="-ml-8" />
              <a-button type="primary" class="ml-5" @click="onClickCost">查看费用清单</a-button>
              <a-button type="primary" class="mx-2" @click="onPrint">查看收据</a-button>
              <a-button type="primary" class="mr-2" :disabled="formState.status === 1" @click="onClickHeavy">重算费用</a-button>
            </div>

            <div class="w-full flex">
              <a-form-item label="票据代码">
                <a-input :ref="(e) => setSubRef(e, 'billCode')" v-model:value="formState.billCode" class="w-[242px]" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="票据号码">
                <a-input :ref="(e) => setSubRef(e, 'billNo')" v-model:value="formState.billNo" class="w-[238px]" :disabled="formState.status === 1" />
              </a-form-item>
            </div>

            <div class="w-full flex">
              <a-form-item label="住院费用（元）：总费用">
                <div class="flex items-end">
                  <a-input v-model:value="formState.medfeeSumamt" class="w-[146px]" disabled />
                  （自付金额
                  <a-input v-model:value="formState.selfpayAmt" class="w-[146px]" disabled />）
                </div>
              </a-form-item>
              <a-form-item label="未归类费用" :class="{ 'cost-label': formState.noneFee > 0 }">
                <a-input v-model:value="formState.noneFee" class="w-[146px]" disabled />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="1.综合医疗服务类：（1）一般医疗服务费">
                <a-input v-model:value="formState.ordnMedServfee" class="w-[140px]" disabled />
              </a-form-item>
              <a-form-item label="（2）一般治疗操作费">
                <a-input v-model:value="formState.ordnTrtOprtFee" class="w-[140px]" disabled />
              </a-form-item>
              <a-form-item label="（3）护理费">
                <a-input v-model:value="formState.nursFee" class="w-[140px]" disabled />
              </a-form-item>
              <a-form-item label="（4）其他费用">
                <a-input v-model:value="formState.comMedServOthFee" class="w-[140px]" disabled />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="2.诊断类：（5）病理诊断费">
                <a-input v-model:value="formState.palgDiagFee" class="w-[140px]" disabled />
              </a-form-item>
              <a-form-item label="（6）实验室诊断费">
                <a-input v-model:value="formState.labDiagFee" class="w-[140px]" disabled />
              </a-form-item>
              <a-form-item label="（7）影像学诊断费">
                <a-input v-model:value="formState.rdhyDiagFee" class="w-[140px]" disabled />
              </a-form-item>
              <a-form-item label="（8）临床诊断项目费">
                <a-input v-model:value="formState.clncDiseFee" class="w-[140px]" disabled />
              </a-form-item>
            </div>

            <div class="w-full flex items-center">
              <a-form-item label="3.治疗类：（9）非手术治疗项目费">
                <div class="flex items-end">
                  <a-input v-model:value="formState.nsrgtrtItemFee" class="w-[100px]" disabled />
                  （临床物理治疗费
                  <a-input v-model:value="formState.clncPhysTrtFee" class="w-[100px]" disabled />）
                </div>
              </a-form-item>
              <a-form-item label="（10）手术治疗费" class="w-1/2">
                <div class="flex items-end">
                  <a-input v-model:value="formState.rgtrtTrtFee" class="w-[100px]" disabled />
                  （麻醉费
                  <a-input v-model:value="formState.anstFee" class="w-[100px]" disabled />
                  手术费
                  <a-input v-model:value="formState.rgtrtFee" class="w-[100px]" disabled />）
                </div>
              </a-form-item>
            </div>

            <div class="w-full">
              <a-form-item label="4.康复类：（11）康复费">
                <a-input v-model:value="formState.rhabFee" class="w-[180px]" disabled />
              </a-form-item>
            </div>
            <div class="w-full">
              <a-form-item label="5.中医类：（12）中医治疗费">
                <a-input v-model:value="formState.tcmTrtFee" class="w-[150px]" disabled />
              </a-form-item>
            </div>
            <div class="w-full">
              <a-form-item label="6.西药类：（13）西药费" class="flex items-end">
                <a-input v-model:value="formState.wmFee" class="w-[180px]" disabled />
                （抗菌药物费用
                <a-input v-model:value="formState.abtlMednFee" class="w-[180px]" disabled />）
              </a-form-item>
            </div>
            <div class="w-full flex">
              <a-form-item label="7.中药类：（14）中成药费">
                <a-input v-model:value="formState.tcmpatFee" class="w-[170px]" disabled />
              </a-form-item>
              <a-form-item label="（15）中草药费">
                <a-input v-model:value="formState.tcmherbFee" class="w-[175px]" disabled />
              </a-form-item>
            </div>

            <div class="w-full flex items-center">
              <a-form-item label="8.血液和血液制品类（16）血费">
                <a-input v-model:value="formState.bloFee" class="w-[68px]" disabled />
              </a-form-item>
              <a-form-item label="（17）白蛋白类制品费" class="pl-6">
                <a-input v-model:value="formState.albuFee" class="w-[68px]" disabled />
              </a-form-item>
              <a-form-item label="（18）球蛋白类制品费" class="pl-6">
                <a-input v-model:value="formState.glonFee" class="w-[68px]" disabled />
              </a-form-item>
              <a-form-item label="（19）凝血因子类制品费" class="pl-6">
                <a-input v-model:value="formState.clotfacFee" class="w-[68px]" disabled />
              </a-form-item>
              <a-form-item label="（20）细胞因子类制品费" class="pl-6">
                <a-input v-model:value="formState.cykiFee" class="w-[68px]" disabled />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="9.耗材类：（21）检查用一次性医用材料费">
                <a-input v-model:value="formState.examDspoMatlFee" class="w-[150px]" disabled />
              </a-form-item>
              <a-form-item label="（22）治疗用一次性医用材料费" class="pl-8">
                <a-input v-model:value="formState.trtDspoMatlFee" class="w-[150px]" disabled />
              </a-form-item>
              <a-form-item label="（23）手术用一次性医用材料费" class="pl-8">
                <a-input v-model:value="formState.oprnDspoMatlFee" class="w-[150px]" disabled />
              </a-form-item>
            </div>
            <a-form-item label="10.其他类：（24）其他费">
              <a-input v-model:value="formState.othFee" class="w-[170px]" disabled />
            </a-form-item>

            <BaseTitle id="tab6" title="附页" class="-ml-8" />
            <a-form-item label="入院时情况" class="w-full">
              <SelectItem
                v-model:value="formState.admissionConditionCode"
                :disabled="formState.status === 1"
                type="DT00316"
                trigger="init"
                class="!w-1/5"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.admissionConditionCode = $event.value
                    formState.admissionConditionName = $event.label
                  }
                "
              />
            </a-form-item>
            <div class="w-full flex items-center">
              <a-form-item label="转入方式" class="w-1/4 mr-2">
                <a-select
                  :ref="(e) => setSubRef(e, 'transferMethodCode')"
                  v-model:value="formState.transferMethodCode"
                  placeholder="请选择"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                >
                  <a-select-option value="1">医联体转入</a-select-option>
                  <a-select-option value="2">社区医院转入</a-select-option>
                  <a-select-option value="3">其他</a-select-option>
                </a-select>
              </a-form-item>
              <a-form-item label="" class="w-9/12">
                <a-input :ref="(e) => setSubRef(e, 'transferPup')" v-model:value="formState.transferPup" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="转出方式" class="w-1/4 mr-2">
                <a-select
                  :ref="(e) => setSubRef(e, 'transferOutMethodCode')"
                  v-model:value="formState.transferOutMethodCode"
                  placeholder="请选择"
                  :show-arrow="false"
                  :disabled="formState.status === 1"
                >
                  <a-select-option value="1">转出至医联体</a-select-option>
                  <a-select-option value="2">转出至社区</a-select-option>
                </a-select>
              </a-form-item>
              <a-form-item label="" class="w-9/12">
                <a-input :ref="(e) => setSubRef(e, 'transferOutPup')" v-model:value="formState.transferOutPup" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="日常生活能力评定量表(入院)得分" class="w-1/4 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'admissionAdlScore')" v-model:value="formState.admissionAdlScore" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="日常生活能力评定量表(出院)得分" class="w-1/4">
                <a-input :ref="(e) => setSubRef(e, 'dischargeAdlScore')" v-model:value="formState.dischargeAdlScore" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="抗生素使用情况" class="w-1/4 mr-2">
                <SelectItem
                  v-model:value="formState.antibioticUsageCode"
                  :disabled="formState.status === 1"
                  type="DT00317"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.antibioticUsageCode = $event.value
                      formState.antibioticUsageName = $event.label
                    }
                  "
                />
              </a-form-item>
              <a-form-item label="目的" class="w-1/4 mr-2">
                <SelectItem
                  v-model:value="formState.antibioticUsagePupCode"
                  :disabled="formState.status === 1"
                  type="DT00318"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.antibioticUsagePupCode = $event.value
                      formState.antibioticUsagePupName = $event.label
                    }
                  "
                />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="方案" class="w-1/4 mr-2">
                <SelectItem
                  v-model:value="formState.planCode"
                  :disabled="formState.status === 1"
                  type="DT00319"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.planCode = $event.value
                      formState.planName = $event.label
                    }
                  "
                />
              </a-form-item>
              <a-form-item label="使用天数" class="w-1/4 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'useDay')" v-model:value="formState.useDay" suffix="天" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <a-form-item label="传染病报告" class="w-full">
              <SelectItem
                v-model:value="formState.diseaseReportCode"
                :disabled="formState.status === 1"
                type="DT00320"
                class="!w-1/5"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.diseaseReportCode = $event.value
                    formState.diseaseReportName = $event.label
                  }
                "
              />
            </a-form-item>
            <div class="w-full flex items-center">
              <a-form-item label="特级护理天数" class="w-1/4 mr-2">
                <a-input
                  :ref="(e) => setSubRef(e, 'specialCareDays')"
                  v-model:value="formState.specialCareDays"
                  suffix="天"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
              <a-form-item label="一级护理" class="w-1/4 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'level1Care')" v-model:value="formState.level1Care" suffix="天" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="二级护理" class="w-1/4 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'level2Care')" v-model:value="formState.level2Care" suffix="天" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="三级护理" class="w-1/4 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'level3Care')" v-model:value="formState.level3Care" suffix="天" :disabled="formState.status === 1" />
              </a-form-item>
            </div>
            <a-form-item label="住院期间是否出现危重" class="w-full">
              <SelectItem
                v-model:value="formState.anyCriticalConditionCode"
                :disabled="formState.status === 1"
                type="DT00321"
                class="!w-1/5"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.anyCriticalConditionCode = $event.value
                    formState.anyCriticalConditionName = $event.label
                  }
                "
              />
            </a-form-item>
            <a-form-item label="是否有非计划二次手术" class="w-full">
              <SelectItem
                v-model:value="formState.unplannedSecondSurgeryCode"
                :disabled="formState.status === 1"
                type="DT00322"
                class="!w-1/5"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.unplannedSecondSurgeryCode = $event.value
                    formState.unplannedSecondSurgeryName = $event.label
                  }
                "
              />
            </a-form-item>
            <a-form-item label="住院过程中有无进入重症监护室" class="w-full">
              <SelectItem
                v-model:value="formState.toIcuCode"
                :disabled="formState.status === 1"
                type="DT00323"
                class="!w-1/5"
                trigger="init"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.toIcuCode = $event.value
                    formState.toIcuName = $event.label
                  }
                "
              />
            </a-form-item>
            <div class="w-full flex items-center">
              <a-form-item label="重症监护室名称" class="w-4/12 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'icuName1')" v-model:value="formState.icuName1" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="进入时间" class="w-4/12 mr-2">
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'icuAdmissionTime1')"
                  v-model:value="formState.icuAdmissionTime1"
                  show-time
                  format="YYYY-MM-DD HH:mm:ss"
                  value-format="YYYY-MM-DD HH:mm:ss"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
              <a-form-item label="转出时间" class="w-4/12 mr-2">
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'icuOutTime1')"
                  v-model:value="formState.icuOutTime1"
                  show-time
                  format="YYYY-MM-DD HH:mm:ss"
                  value-format="YYYY-MM-DD HH:mm:ss"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="重症监护室名称" class="w-4/12 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'icuName2')" v-model:value="formState.icuName2" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="进入时间" class="w-4/12 mr-2">
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'icuAdmissionTime2')"
                  v-model:value="formState.icuAdmissionTime2"
                  show-time
                  format="YYYY-MM-DD HH:mm:ss"
                  value-format="YYYY-MM-DD HH:mm:ss"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
              <a-form-item label="转出时间" class="w-4/12 mr-2">
                <a-date-picker
                  :ref="(e) => setSubRef(e, 'icuOutTime2')"
                  v-model:value="formState.icuOutTime2"
                  show-time
                  format="YYYY-MM-DD HH:mm:ss"
                  value-format="YYYY-MM-DD HH:mm:ss"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
            </div>
            <div class="w-full flex items-center">
              <a-form-item label="HBsAg" class="w-1/4 mr-2">
                <SelectItem
                  v-model:value="formState.hbsAgCode"
                  :disabled="formState.status === 1"
                  type="DT00324"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.hbsAgCode = $event.value
                      formState.hbsAgName = $event.label
                    }
                  "
                />
              </a-form-item>
              <a-form-item label="HCV-Ab" class="w-1/4 mr-2">
                <SelectItem
                  v-model:value="formState.hcvAbCode"
                  :disabled="formState.status === 1"
                  type="DT00325"
                  trigger="init"
                  placeholder="请选择"
                  @change="
                    (_, $event) => {
                      formState.hcvAbCode = $event.value
                      formState.hcvAbName = $event.label
                    }
                  "
                />
              </a-form-item>
            </div>
            <a-form-item label="HIV-Ab" class="w-full">
              <SelectItem
                v-model:value="formState.hivAbCode"
                :disabled="formState.status === 1"
                type="DT00326"
                trigger="init"
                class="!w-1/5"
                placeholder="请选择"
                @change="
                  (_, $event) => {
                    formState.hivAbCode = $event.value
                    formState.hivAbName = $event.label
                  }
                "
              />
            </a-form-item>
            <div class="w-full flex items-center">
              <a-form-item label="红细胞" class="w-1/5 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'redBloodCell')" v-model:value="formState.redBloodCell" suffix="单位" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="血小板" class="w-1/5 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'platelet')" v-model:value="formState.platelet" suffix="单位" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="血浆" class="w-1/5 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'plasma')" v-model:value="formState.plasma" suffix="单位" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="全血" class="w-1/5 mr-2">
                <a-input :ref="(e) => setSubRef(e, 'wholeBlood')" v-model:value="formState.wholeBlood" suffix="单位" :disabled="formState.status === 1" />
              </a-form-item>
              <a-form-item label="自体血回输" class="w-1/5 mr-2">
                <a-input
                  :ref="(e) => setSubRef(e, 'autoBloodTransf')"
                  v-model:value="formState.autoBloodTransf"
                  suffix="单位"
                  :disabled="formState.status === 1"
                />
              </a-form-item>
            </div>

            <!-- <a-divider class="my-2" dashed /> -->

            <!-- <div class="w-full">
              说明：（一）医疗付费方式： 1.城镇职工基本医疗保险 2.城镇居民基本医疗保险 3.新型农村合作医疗 4.贫困救助 5.商业医疗保险 6.全公费 7.全自费
              8.其他社会保险 9.其他
            </div>
            <div class="w-full">（二）凡可由医院信息系统提供住院费用清单的，住院病案首页中可不填写“住院费用”。</div> -->
          </a-form>
        </div>
      </a-card>
      <a-card class="w-72 ml-2 history-card" :class="historyExpand ? 'history-expand' : ''" :body-style="{ paddingTop: 0 }">
        <div class="history-expand-btn" @click="() => (historyExpand = !historyExpand)">
          <DoubleLeftOutlined v-if="historyExpand" />
          <DoubleRightOutlined v-else />
        </div>
        <div v-if="historyExpand" class="pt-12 text-primary font-semibold">病案质控</div>
        <div v-if="historyExpand" class="mt-2">
          <div class="pt-2 text-primary">完整性：{{ testingTotal }}</div>
        </div>
        <a-tabs v-model:active-key="leftActiveKey" centered>
          <a-tab-pane key="1">
            <template #tab>
              <div class="px-5 text-center">病案质控</div>
            </template>
            <div class="overflow-auto" style="height: calc(100vh - 300px)">
              <template v-if="testingData.length > 0">
                <div v-for="item in testingData" :key="item" class="cursor-pointer" @click="onClickLocate(item)">
                  <div class="flex justify-between">
                    <div class="flex items-center">
                      <a-tag color="blue">{{ ['完整性', '准确性', '规范性', '逻辑性'][Number(item.qcruleType) - 1] }}</a-tag>
                      <div class="mx-1">{{ item.qcruleTitle }}</div>
                    </div>
                    <AimOutlined />
                  </div>
                  <div class="text-gray-500 mt-3">{{ item.qcruleDetail }}</div>
                  <a-divider class="my-3" />
                </div>
              </template>
              <template v-else>
                <a-empty />
              </template>
            </div>
          </a-tab-pane>
        </a-tabs>
      </a-card>
    </div>
    <TestingModal v-model:open="openTest" />
    <CostListModal v-model:open="openCost" :inplsh="inplsh" />
    <SelectPrint v-model:open="openPrint" @success="onPrintInfo" />
  </a-spin>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue'
import { AimOutlined } from '@ant-design/icons-vue'
import { DoubleRightOutlined, DoubleLeftOutlined } from '@ant-design/icons-vue'
import dayjs from 'dayjs'
import { formatAmount } from '@/utils/format'
import { post } from '@/utils/request'
import { getSystemConfig } from '@/utils/systemConfig'
import cofirmModal from '@/utils/confirm.js'
import SelectAllergyModal from '@/components/SelectAllergy'

import TabDispose from '@/views/in-doctor/workstation/components/TabDispose'
import OperationTable from './components/OperationTable'
import TestingModal from './components/TestingModal.vue'
import CostListModal from './components/CostListModal.vue'
import SelectPrint from './components/SelectPrint.vue'
// import formRef from './formRef'

const router = useRouter()
const openTest = ref(false)
const openCost = ref(false)
const openPrint = ref(false)
const loading = ref(false)
// const formAll = ref()
const historyExpand = ref(true)
const testingData = ref([])
const testingTotal = ref(0)
const leftActiveKey = ref('1')
const printRef = ref(null)
const formState = ref({})
const activeKey = ref('tab1')
const props = defineProps({
  inplsh: {
    type: String,
    default: ''
  },
  formHeight: {
    type: Boolean,
    default: false
  },
  isRoute: {
    type: Boolean,
    default: false
  }
})

const onChangeTabs = () => {
  const targetElement = document.querySelector(`#${activeKey.value}`)
  // 使用scrollIntoView方法实现平滑滚动效果
  targetElement.scrollIntoView({
    behavior: 'smooth',
    block: 'start' // 滚动到目标元素顶部
  })
}
// const diagnosisColumns = [
//   { title: '出院诊断', dataIndex: 'icd10TypeName' },
//   { title: '部位', dataIndex: 'bw' },
//   // { title: '诊断名称', dataIndex: 'zdmc' },
//   { title: '疾病编码', dataIndex: 'icd10Code' },
//   { title: '入院病情', dataIndex: 'checkinConditionName' },
//   { title: '出院情况', dataIndex: 'checkoutConditionName' }
// ]

// 现地址
const provinceListOne = ref([]) // 省
const cityListOne = ref([]) // 市
const countyListOne = ref([]) // 区
const provinceSearchOne = ref('') // 市请求参数
const citySearchOne = ref('') // 区请求参数
//户口地址
const provinceListTwo = ref([]) // 省
const cityListTwo = ref([]) // 市
const countyListTwo = ref([]) // 区
const provinceSearchTwo = ref('') // 市请求参数
const citySearchTwo = ref('') // 区请求参数
// 联系人地址
const provinceListThree = ref([]) // 省
const cityListThree = ref([]) // 市
const countyListThree = ref([]) // 区
const provinceSearchThree = ref('') // 市请求参数
const citySearchThree = ref('') // 区请求参数
// 获取病案信息
const getMedicalRecordInfo = async (isNew = false) => {
  loading.value = true
  const { code, data, msg } = await post('/med/MedicalRecord/getBasicInformationOfMedicalRecords', {
    inplsh: props.inplsh,
    requireNew: isNew
  })
  if (code !== 0) return message.error(msg)
  formState.value = data?.mrBazbResponse
  formState.value.dscgDays31RinpFlag = formState.value.dscgDays31RinpFlag || '1'
  formState.value.dscgDays31RinpFlagName = formState.value.dscgDays31RinpFlagName || '无'
  formState.value.jkkh = getSystemConfig('NMI_REGION_CODE') === '02' ? formState.value.psnNo : formState.value.insureNo
  formState.value.medfeeSumamt = formatAmount(formState.value.medfeeSumamt)
  formState.value.selfpayAmt = formatAmount(formState.value.selfpayAmt)
  formState.value.noneFee = formatAmount(formState.value.noneFee)
  formState.value.ordnMedServfee = formatAmount(formState.value.ordnMedServfee)
  formState.value.ordnTrtOprtFee = formatAmount(formState.value.ordnTrtOprtFee)
  formState.value.nursFee = formatAmount(formState.value.nursFee)
  formState.value.comMedServOthFee = formatAmount(formState.value.comMedServOthFee)
  formState.value.palgDiagFee = formatAmount(formState.value.palgDiagFee)
  formState.value.labDiagFee = formatAmount(formState.value.labDiagFee)
  formState.value.rdhyDiagFee = formatAmount(formState.value.rdhyDiagFee)
  formState.value.clncDiseFee = formatAmount(formState.value.clncDiseFee)
  formState.value.nsrgtrtItemFee = formatAmount(formState.value.nsrgtrtItemFee)
  formState.value.clncPhysTrtFee = formatAmount(formState.value.clncPhysTrtFee)
  formState.value.rgtrtTrtFee = formatAmount(formState.value.rgtrtTrtFee)
  formState.value.anstFee = formatAmount(formState.value.anstFee)
  formState.value.rgtrtFee = formatAmount(formState.value.rgtrtFee)
  formState.value.rhabFee = formatAmount(formState.value.rhabFee)
  formState.value.tcmTrtFee = formatAmount(formState.value.tcmTrtFee)
  formState.value.wmFee = formatAmount(formState.value.wmFee)
  formState.value.abtlMednFee = formatAmount(formState.value.abtlMednFee)
  formState.value.tcmpatFee = formatAmount(formState.value.tcmpatFee)
  formState.value.tcmherbFee = formatAmount(formState.value.tcmherbFee)
  formState.value.bloFee = formatAmount(formState.value.bloFee)
  formState.value.albuFee = formatAmount(formState.value.albuFee)
  formState.value.glonFee = formatAmount(formState.value.glonFee)
  formState.value.clotfacFee = formatAmount(formState.value.clotfacFee)
  formState.value.cykiFee = formatAmount(formState.value.cykiFee)
  formState.value.examDspoMatlFee = formatAmount(formState.value.examDspoMatlFee)
  formState.value.trtDspoMatlFee = formatAmount(formState.value.trtDspoMatlFee)
  formState.value.oprnDspoMatlFee = formatAmount(formState.value.oprnDspoMatlFee)
  formState.value.othFee = formatAmount(formState.value.othFee)
  // 把dscgDate这个字段，分成年月日，时分秒两个字段存储
  if (formState.value.dscgDate) {
    formState.value.dscgDateYear = dayjs(formState.value.dscgDate).format('YYYY-MM-DD')
    formState.value.dscgDateMonth = dayjs(formState.value.dscgDate).format('HH:mm:ss')
  }
  loading.value = false
  if (formState.value.ssxx && formState.value.ssxx.length) {
    formState.value.ssxx.forEach((item) => {
      if (!item.oprAptmPartList) {
        item.oprAptmPartList = []
      }
    })
  }
  if (formState.value.currAddrProv) {
    provinceSearchOne.value = formState.value.currAddrProv
    getProvince('province', 1)
  }
  if (formState.value.currAddrCity) {
    citySearchOne.value = formState.value.currAddrCity
    getProvince('city', 1)
  }
  if (formState.value.resdAddrProv) {
    provinceSearchTwo.value = formState.value.resdAddrProv
    getProvince('province', 2)
  }
  if (formState.value.resdAddrCity) {
    citySearchTwo.value = formState.value.resdAddrCity
    getProvince('city', 2)
  }
  if (formState.value.conerAddrProv) {
    provinceSearchThree.value = formState.value.conerAddrProv
    getProvince('province', 3)
  }
  if (formState.value.conerAddrCity) {
    citySearchThree.value = formState.value.conerAddrCity
    getProvince('city', 3)
  }
  for (let i = 1; i <= 3; i++) {
    getProvince('', i)
  }
  getTestingData() // 质控检测
  !formState.value.qltctrlDrCode && getDoctorByCode()
}

// 获取质控检测
const getTestingData = async () => {
  const { code, data, msg, total } = await post('/med/MedicalRecord/executeMrQcrule', formState.value)
  if (code !== 0) return message.error(msg)
  testingData.value = data
  testingTotal.value = total
}
// 点击定位
const onClickLocate = (row) => {
  // ant-select-selector   下拉框
  // ant-picker-input  时间框
  const selectName = subRef.value[row.itemId].$el.querySelector('.ant-select-selector')
  const timeName = subRef.value[row.itemId].$el.querySelector('.ant-picker-input')
  if (selectName) {
    // 下拉框
    selectName.style = 'border-bottom-color:red;color:red'
    selectName.querySelector('input').click()
    selectName.querySelector('input').focus()
  } else if (timeName) {
    // 时间框
    timeName.querySelector('input').focus()
    subRef.value[row.itemId].$el.style = 'border-bottom-color:red'
    timeName.querySelector('input').style = 'color:red'
  } else {
    const inputName = subRef.value[row.itemId].$el.querySelector('.ant-input') // 年龄不足1岁的input层级不同
    if (inputName) {
      inputName.focus()
      inputName.style = 'border-bottom-color:red;color:red'
    } else {
      // 输入框
      subRef.value[row.itemId].$el.focus()
      subRef.value[row.itemId].$el.style = 'border-bottom-color:red;color:red'
    }
  }
}

// 动态ref
const subRef = ref({})
const setSubRef = (e, name) => {
  subRef.value[name] = e
}

// 省市区
const getProvince = async (status = '', state) => {
  if (state === 1) {
    if (!status) {
      provinceSearchOne.value = ''
      citySearchOne.value = ''
    }
    if (status === 'province') {
      citySearchOne.value = ''
    }
    const { code, data, msg } = await post('/common/masterData/getProvinceCityDistrictInfoList', {
      city: citySearchOne.value,
      county: '',
      name: '',
      pageNum: 1,
      pageSize: 100,
      province: provinceSearchOne.value
    })
    if (code !== 0) return message.error(msg)
    !status && data?.length && (provinceListOne.value = data)
    status === 'province' && data?.length && (cityListOne.value = data)
    status === 'city' && data?.length && (countyListOne.value = data)
  }
  if (state === 2) {
    if (!status) {
      provinceSearchTwo.value = ''
      citySearchTwo.value = ''
    }
    if (status === 'province') {
      citySearchTwo.value = ''
    }
    const { code, data, msg } = await post('/common/masterData/getProvinceCityDistrictInfoList', {
      city: citySearchTwo.value,
      county: '',
      name: '',
      pageNum: 1,
      pageSize: 100,
      province: provinceSearchTwo.value
    })
    if (code !== 0) return message.error(msg)
    !status && data?.length && (provinceListTwo.value = data)
    status === 'province' && data?.length && (cityListTwo.value = data)
    status === 'city' && data?.length && (countyListTwo.value = data)
  }
  if (state === 3) {
    if (!status) {
      provinceSearchThree.value = ''
      citySearchThree.value = ''
    }
    if (status === 'province') {
      citySearchThree.value = ''
    }
    const { code, data, msg } = await post('/common/masterData/getProvinceCityDistrictInfoList', {
      city: citySearchThree.value,
      county: '',
      name: '',
      pageNum: 1,
      pageSize: 100,
      province: provinceSearchThree.value
    })
    if (code !== 0) return message.error(msg)
    !status && data?.length && (provinceListThree.value = data)
    status === 'province' && data?.length && (cityListThree.value = data)
    status === 'city' && data?.length && (countyListThree.value = data)
  }
}

// 选择地址
const selectAddres = (val, status, state) => {
  if (state === 1) {
    if (val && status === 'province') {
      provinceSearchOne.value = val
      formState.value.currAddrCity = null
      formState.value.currAddrCoty = null
      citySearchOne.value = ''
    }
    if (val && status === 'city') {
      citySearchOne.value = val
      provinceSearchOne.value = formState.value.currAddrProv
      formState.value.currAddrCoty = null
    }
    if (!val && status === 'province') {
      formState.value.currAddrCity = null
      formState.value.currAddrCoty = null
    }
    if (!val && status === 'city') {
      formState.value.currAddrCoty = null
    }
  }
  if (state === 2) {
    if (val && status === 'province') {
      provinceSearchTwo.value = val
      formState.value.resdAddrCity = null
      formState.value.resdAddrCoty = null
      citySearchTwo.value = ''
    }
    if (val && status === 'city') {
      citySearchTwo.value = val
      provinceSearchTwo.value = formState.value.resdAddrProv
      formState.value.resdAddrCoty = null
    }
    if (!val && status === 'province') {
      formState.value.resdAddrCity = null
      formState.value.resdAddrCoty = null
    }
    if (!val && status === 'city') {
      formState.value.resdAddrCoty = null
    }
  }
  if (state === 3) {
    if (val && status === 'province') {
      provinceSearchThree.value = val
      formState.value.conerAddrCity = null
      formState.value.conerAddrCoty = null
      citySearchThree.value = ''
    }
    if (val && status === 'city') {
      citySearchThree.value = val
      provinceSearchThree.value = formState.value.conerAddrProv
      formState.value.conerAddrCoty = null
    }
    if (!val && status === 'province') {
      formState.value.conerAddrCity = null
      formState.value.conerAddrCoty = null
    }
    if (!val && status === 'city') {
      formState.value.conerAddrCoty = null
    }
  }

  getProvince(status, state)
}

// 提交、撤销提交
const onSubmit = async (status) => {
  const { code, msg } = await post('/med/MedicalRecord/doUpdMrBazb', {
    inplsh: props.inplsh,
    status
  })
  if (code !== 0) return message.error(msg)
  message.success(msg)
  getMedicalRecordInfo()
}
// formState.qltctrlDrName = event.empName
// formState.qltctrlDrCode = event.empId
const getDoctorByCode = async () => {
  const { code, data } = await post('common/emp/getEmpInfoBySettingCode', {
    settingCode: 'INP_QC_DEFAULT_DOCTOR_CODE'
  })
  if (code === 0) {
    formState.value.qltctrlDrName = data.empName
    formState.value.qltctrlDrCode = data.empId
  }
}
// 保存
const onSave = async () => {
  if (formState.value.antibioticUsageName && formState.value.antibioticUsageName !== '无') {
    if (!formState.value.antibioticUsagePupCode) return message.error('抗生素使用目的为空！')
    if (!formState.value.planCode) return message.error('抗生素使用方案为空！')
    if (!formState.value.useDay && formState.value.useDay !== 0) return message.error('抗生素使用天数为空！')
  }
  // getSystemConfig('NMI_REGION_CODE') === '02'   阜阳
  if (getSystemConfig('NMI_REGION_CODE') === '02' && formState.value.currAddrCoty && !formState.value.currAddrPoscode) {
    return message.error('现地址邮编为空！')
  }
  if (getSystemConfig('NMI_REGION_CODE') === '02' && formState.value.resdAddrCoty && !formState.value.resdAddrPoscode) {
    return message.error('户口地址邮编为空！')
  }
  if (getSystemConfig('NMI_REGION_CODE') === '02' && formState.value.emprAddr && !formState.value.emprPoscode) {
    return message.error('工作单位及地址邮编为空！')
  }
  const isType = formState.value.ssxx?.some((item) => {
    return item.operationType === null || item.operationType === '' || item.operationType === undefined
  })
  if (isType) return message.error('手术及操作类型为空！')
  const isCode = formState.value.ssxx?.some((item) => {
    return item.oprCode === null || item.oprCode === '' || item.oprCode === undefined
  })
  if (isCode) return message.error('手术及操作编码为空！')
  const isDate = formState.value.ssxx?.some((item) => {
    return item.oprDate === null || item.oprDate === '' || item.oprDate === undefined
  })
  if (isDate) return message.error('手术及操作日期为空！')
  const isDoctorName = formState.value.ssxx?.some((item) => {
    return item.oprDoctorName === null || item.oprDoctorName === '' || item.oprDoctorName === undefined
  })
  if (isDoctorName) return message.error('术者为空！')
  formState.value.nwbBirWt = formState.value.nwbBirWt || null
  formState.value.nwbAdmWt = formState.value.nwbAdmWt || null
  if (formState.value.dscgDateYear || formState.value.dscgDateMonth) {
    formState.value.dscgDate = `${formState.value.dscgDateYear} ${formState.value.dscgDateMonth}`
  }
  const { code, msg } = await post('/med/MedicalRecord/doSaveMrBazb', { ...formState.value, inplsh: props.inplsh })
  if (code !== 0) return message.error(msg)
  message.success(msg)
  getMedicalRecordInfo()
}

// 质控检测
// const onClickTest = () => {
// if (testingData.value.length) {
//   historyExpand.value = false
// } else {
//   message.error('暂无')
// }
// message.warning('暂未开放')
// openTest.value = true
// }

// 查看费用清单
const onClickCost = () => {
  openCost.value = true
}

// 重算费用
const onClickHeavy = async () => {
  const isConfirm = await cofirmModal({ title: '提示', content: '确认重算费用？' })
  if (isConfirm) {
    const { code, msg } = await post('/med/MedicalRecord/CalculateTheCost', { inplsh: props.inplsh })
    if (code !== 0) return message.error(msg)
    message.success(msg)
    getMedicalRecordInfo()
  }
}

// 查看收据打印
const onPrint = async () => {
  const { code, msg, data } = await post('/inp/Print/printSettlementDocumentsList', { inplsh: props.inplsh, jslb: 'SF', dylb: 'BA' })
  if (code !== 0) return message.error(msg)
  window.openExe?.rpt(data) //调用winform打印
}

// 点击选择打印
const onPrintSelect = () => {
  openPrint.value = true
}

// 打印
const onPrintInfo = async (printArray = []) => {
  if (printArray.length > 0) {
    if (printArray.includes(1)) {
      const { code, msg, data } = await post('/med/MedicalRecord/printHomePageOfMedicalRecords', { inplsh: props.inplsh, jslb: 'SF' })
      if (code !== 0) return message.error(msg)
      if (getSystemConfig('NAVYHIS_MODE') === '1') {
        setTimeout(() => {
          printRef.value.$el.click()
        }, 1000)
      } else {
        window.openExe?.rpt(data) //调用winform打印
      }
    }
    if (printArray.includes(2)) {
      const { code, msg, data } = await post('/med/MedicalRecord/printHomePageOfMedicalRecordsBack', { inplsh: props.inplsh, jslb: 'SF' })
      if (code !== 0) return message.error(msg)
      window.openExe?.rpt(data) //调用winform打印
    }
    if (printArray.includes(3)) {
      if (getSystemConfig('NMI_REGION_CODE') === '02') {
        const { code, msg, data } = await post('/med/MedicalRecord/printHomePageOfMedicalRecordsFy', { inplsh: props.inplsh, jslb: 'SF' })
        if (code !== 0) return message.error(msg)
        window.openExe?.rpt(data) //调用winform打印
      }
    }
  }
  // const { code, msg, data } = await post('/med/MedicalRecord/printHomePageOfMedicalRecords', { inplsh: props.inplsh, jslb: 'SF' })
  //     if (code !== 0) return message.error(msg)
  //     if (getSystemConfig('NAVYHIS_MODE') === '1') {
  //       setTimeout(() => {
  //         printRef.value.$el.click()
  //       }, 1000)
  //     } else {
  //       window.openExe?.rpt(data) //调用winform打印
  //       if (data) {
  //         const {
  //           code: codeBack,
  //           msg: msgBack,
  //           data: dataBack
  //         } = await post('/med/MedicalRecord/printHomePageOfMedicalRecordsBack', { inplsh: props.inplsh, jslb: 'SF' })
  //         if (codeBack !== 0) return message.error(msgBack)
  //         window.openExe?.rpt(dataBack) //调用winform打印
  //         if (getSystemConfig('NMI_REGION_CODE') === '02') {
  //           const { code, msg, data } = await post('/med/MedicalRecord/printHomePageOfMedicalRecordsFy', { inplsh: props.inplsh, jslb: 'SF' })
  //           if (code !== 0) return message.error(msg)
  //           window.openExe?.rpt(data) //调用winform打印
  //         }
  //       }
  //     }
}

const formatTimes = (val, time) => {
  if (val) {
    if (val.split(' ').length >= 2) {
      if (time === 'date') return val.split(' ')[0]
      if (time === 'time') return val.split(' ')[1]
    } else if (val.split(' ').length === 1) {
      if (time === 'date') return val.split(' ')[0]
      if (time === 'time') ''
    } else {
      return ''
    }
  } else {
    return ''
  }
}

watch(
  () => props.inplsh,
  (val) => {
    val && checkChange()
  }
)
const checkChange = async () => {
  const { code, data, mgs } = await post('/med/MedicalRecord/doContrastBasicInformationOfMedicalRecords', { inplsh: props.inplsh })
  if (code !== 0) return message.error(mgs)
  if (data) {
    const isConfirm = await cofirmModal({ title: '提示', content: '病案数据有更新,确认更新数据？' })
    getMedicalRecordInfo(!!isConfirm)
  } else {
    getMedicalRecordInfo()
  }
}
onMounted(() => props.inplsh && checkChange())
</script>
<style lang="less" scoped>
:deep(.workstation-tabs) {
  .ant-tabs-tab {
    padding: 12px 32px;
  }
  .ant-tabs-tab + .ant-tabs-tab {
    margin: 0 16px;
  }
}

// 病案管理
.h-calc-120 {
  height: calc(100vh - 120px) !important;
}

.form-box {
  height: calc(100vh - 255px);
  margin-bottom: 15px;
  overflow: auto;
}
.form-style {
  // height: calc(100vh - 100px);
  // overflow: auto;
  :deep(label) {
    align-items: flex-end;
    padding-top: 3px;
  }
  :deep(.ant-form-row) {
    margin-right: 24px;
  }
  :deep(.ant-input-suffix) {
    display: flex;
    align-items: flex-end;
    color: var(--disabled-text-color);
  }
  :deep(.ant-input-affix-wrapper) {
    padding: 0 !important;
  }
  :deep(.can-edit-cell) {
    .ant-select-selector {
      padding: 0 8px !important;
      border: 1px solid transparent !important;
      border-bottom-color: transparent !important;
    }
    .ant-select-selector:hover {
      border-color: var(--primary-color) !important;
    }
    .ant-input {
      padding: 0 8px !important;
    }
  }
  :deep(.ant-input) {
    padding: 9px 0 0 5px !important;
  }
  :deep(.ant-table-cell) {
    height: 36px;
  }
  :deep(.ant-form-item-control-input-content) {
    .ant-input-affix-wrapper,
    .ant-picker,
    .ant-input {
      &-focused {
        box-shadow: none !important;
      }
      border: none;
      border-radius: 0;
    }
    .ant-picker,
    .ant-input {
      &:focus {
        box-shadow: none !important;
      }
      border-bottom: 1px solid #333;
    }
    .ant-picker {
      width: 100%;
      padding: 10px 0 0 5px !important;
    }
  }
  :deep(.ant-select-selector) {
    padding: 4px 0 0 5px !important;
    border: none;
    border-bottom: 1px solid #333;
    border-radius: 0;
    box-shadow: none !important;
  }
  .table-select {
    :deep(.ant-select-selector) {
      border-bottom: none;
      &:hover {
        border: 1px solid var(--primary-color) !important;
      }
    }
  }
  .cost-label {
    :deep(.ant-form-item-label > label) {
      padding-bottom: 1px !important;
      color: red;
    }
    :deep(.ant-input) {
      color: red;
    }
  }
  // 定位样式
  .select-label {
    :deep(.ant-form-item-label > label) {
      color: red;
    }
    .ant-picker,
    .ant-input {
      border-bottom: 1px solid red;
    }
  }
  :deep(.ant-input[disabled]) {
    color: #000;
    background-color: transparent;
  }
  :deep(.ant-input-affix-wrapper-disabled) {
    color: #000;
    background-color: transparent;
  }
  :deep(.ant-input-affix-wrapper[disabled]) {
    color: #000;
    background-color: transparent;
  }
  :deep(.ant-picker.ant-picker-disabled) {
    color: #000;
    background-color: transparent;
  }
  :deep(.ant-picker .ant-picker-input > input[disabled]) {
    color: #000;
    background-color: transparent;
  }
  :deep(.ant-select-disabled .ant-select-selector) {
    color: #000;
    background-color: transparent;
  }
}
#printDom {
  // border: 1px solid #00000080;
  border: 1px solid rgb(203 213 225);
  border-radius: 8px;
}
.history-card {
  transition: all 0.3s;
}
.history-expand {
  width: 100px !important;
  :deep(.ant-tabs) {
    visibility: hidden;
  }
}
.history-expand-btn {
  position: absolute;
  top: 4px;
  right: 38px;
  z-index: 99;
  padding: 8px;
  color: var(--primary-color);
  background-color: var(--secondary-color);
  border-radius: 8px;
  cursor: pointer;
}
</style>
